import socket

class Client:
    def __init__(self):
        self.address = '82.156.200.216', 9998
        # self.address = 'localhost', 9998
        self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        self.sock.connect(self.address)
        self.sock.setblocking(False)

    def send(self, message: str):
        self.sock.sendall(message.encode())

    def recv(self):
        try:
            msg = self.sock.recv(1024).decode()
        except BlockingIOError as e:
            msg = None
        return msg
